package com.fruitshop.info.manager.service;

import com.fruitshop.info.manager.dao.ManagerDao;
import com.fruitshop.info.manager.domain.Manager;

import java.util.ArrayList;
/**此类仅用于实现业务员的登录功能*/
@SuppressWarnings("all")
public class ManagerService {
    ManagerDao dao = new ManagerDao();

    public boolean login(String name, String passWord) {
        ArrayList<Manager> man = dao.login();
        boolean flag = false;
        for (Manager everyMan : man) {
            if(everyMan.getName().equals(name)&&everyMan.getPassWord().equals(passWord)){
                flag = true;
            }
        }
        return flag;
    }
}
